package cn.com.zhuxulin.android.demos.activities;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import cn.com.zhuxulin.android.demos.R;
import cn.com.zhuxulin.android.demos.bussiness.SendSMSMessage;

public class SendMsg extends Activity {
	private EditText phone = null;
	private EditText msg = null;
	private Button send = null;
	private String sMsg = null;
	private String sTel = null;
	private SendSMSMessage smsMessage = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.send_msg);
		phone = (EditText) findViewById(R.id.SendMsgNumber);
		msg = (EditText) findViewById(R.id.Msg);
		send = (Button) findViewById(R.id.SendMsg);
	}

	@Override
	protected void onStart() {
		super.onStart();
		send.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				sMsg = msg.getText().toString();
				sTel = phone.getText().toString();
				smsMessage = new SendSMSMessage(SendMsg.this);
				smsMessage.sendMsg(sTel, sMsg);
			}
		});
	}
}
